import java.util.StringTokenizer;


class P11470_39643 {

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuilder buffer = new StringBuilder();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}
	
	public static void main(String[] args) {
		int caseNumber = 1;
		while (true) {
			int n = Integer.parseInt(readLn());
			
			if (n == 0) break;
			
			int[][] matrix = new int[n][n];
			
			for (int k = 0; k < n; k++) {
				StringTokenizer st = new StringTokenizer(readLn());
				
				for (int j = 0; j < n; j++) {
					matrix[k][j] = Integer.parseInt(st.nextToken());
				}
				
			}
			
			double value = n;
			
//			System.out.println((int)Math.ceil(value/2d));
			
			int[] values = new int[(int)Math.ceil(value/2d)];
			
			StringBuilder sb = new StringBuilder("Case " + caseNumber++ + ": " );
			
			for (int k = 0; k < values.length; k++) {
				
				for (int j = 0 + k; j < n - k; j++) {
//					System.out.println(matrix[k][j]);
					values[k] += matrix[k][j];
				}
				
				for (int j = 1 + k; j < n - k; j++) {
//					System.out.println(matrix[j][n - k - 1]);
					values[k] += matrix[j][n - k - 1];
				}
				
				for (int j = 0 + k; j < n - k - 1; j++) {
//					System.out.println(matrix[n - k - 1][j]);
					values[k] += matrix[n - k - 1][j];
				}
				
				for (int j = 1 + k; j < n - k - 1; j++) {
//					System.out.println(matrix[j][k]);
					values[k] += matrix[j][k];
				}
				
				sb.append(values[k] + " ");
				
			}
			
			System.out.println(sb.toString().trim());
			
		}
	}
	
}
